package cn.xinfei.xdecision.pulsar.config;

import lombok.Data;
import org.apache.pulsar.client.api.SubscriptionInitialPosition;
import org.apache.pulsar.client.api.SubscriptionMode;
import org.apache.pulsar.client.api.SubscriptionType;

import java.util.List;

@Data
public class XPulsarConsumerProperties {
    private List<String> topics;
    private String subscriptionName;
    private String consumerName;
    private String subscriptionMode = SubscriptionMode.Durable.name();
    private String subscriptionType = SubscriptionType.Key_Shared.name();
    private long ackTimeout = 3000;
    private long ackTimeoutTickTime = 1000;
    private Integer acknowledgmentGroupTime = 2;
    private Integer maxPendingChuckedMessage = 100;
    private boolean autoAckOldestChunkedMessageOnQueueFull = true;
    private boolean isAckReceiptEnabled = true;
    private boolean startMessageIdInclusive = true;
    private String subscriptionInitialPosition = SubscriptionInitialPosition.Latest.name();
    private boolean enableRetry = true;

    private Integer maxTotalReceiverQueueSizeAcrossPartitions = 50000;
    private String batchReceivePolicy = "DEFAULT_POLICY";
    private Integer priorityLevel = 1;
    private boolean enableBatchIndexAcknowledgment = true;


    private String tenant = "public";
    private String namespace = "default";

    //    private String deadLetterPolicy(DeadLetterPolicyprivate String builder()
//            private String maxRedeliverCount(5)
//            private String deadLetterTopic("persistent://public/default/dead-letter-topic")
//            private String retryLetterTopic("persistent://public/default/retry-letter-topic")
//            private String build())
//            private String receiverQueueSize(5000)
}
